package com.lmh.service;

import com.lmh.dao.DemandMapper;
import com.lmh.pojo.Demand;
import com.lmh.pojo.ProjectType;
import com.lmh.pojo.Technical;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class DemandServiceImpl implements DemandService{
    @Autowired
    private DemandMapper demandMapper;

    @Override
    public List<ProjectType> projecttypequan() {
        return demandMapper.projecttypequan();
    }

    @Override
    public List<Technical> technicalquan() {
        return demandMapper.technicalquan();
    }

    @Override
    public int demandadd(Demand demand) {
        return demandMapper.demandadd(demand);
    }

    @Override
    public ProjectType projecttypedan(Integer projectTypeId) {
        return demandMapper.projecttypedan(projectTypeId);
    }

    @Override
    public List<Demand> demandall(String flag) {
        return demandMapper.demandall(flag);
    }

    @Override
    public List<Demand> demandlike(String demandProjectName) {

        String s="%"+demandProjectName+"%";
        System.out.println("s:"+s);
        return demandMapper.demandlike(s);
    }

    @Override
    public List<Demand> demandprojecttype(Integer prohectTypeId, String demandProjectName) {
        String s="%"+demandProjectName+"%";
        System.out.println("s:"+s);
        return demandMapper.demandprojecttype(prohectTypeId,s);
    }

    @Override
    public Demand demanddan(String demandId) {
        return demandMapper.demanddan(demandId);
    }
}
